package pl.model.domain;

import java.util.Collection;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="userr")
public class User extends AbstractDBObject {

	public User(String login, String password, String email) {
		super();
		this.login = login;
		this.password = password;
		this.email = email;
	}

	public User(String login, String password, String email, Date birthday,
			String imageFriendlyName, String imagePath,
			Collection<Comment> comments) {
		super();
		this.login = login;
		this.password = password;
		this.email = email;
		this.birthday = birthday;
		this.imageFriendlyName = imageFriendlyName;
		this.imagePath = imagePath;
		this.comments = comments;
	}

	public User(String login, String password, String email, Date birthday) {
		super();
		this.login = login;
		this.password = password;
		this.email = email;
		this.birthday = birthday;
	}

	public User() {
		super();
	}

	String login;
	String password;
	String name;
	String surname;
	String email;
	Date birthday;
	String imageFriendlyName;
	String imagePath;
	Integer rank = 1;
	@OneToMany(mappedBy="user")
	Collection<Comment> comments;

	@Override
	public String toString() {
		return super.toString() + " ";
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getImageFriendlyName() {
		return imageFriendlyName;
	}

	public void setImageFriendlyName(String imageFriendlyName) {
		this.imageFriendlyName = imageFriendlyName;
	}

	public String getImagePath() {
		return imagePath;
	}

	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}

	public Collection<Comment> getComments() {
		return comments;
	}

	public void setComments(Collection<Comment> comments) {
		this.comments = comments;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public User(String login, String password, String name, String surname,
			String email) {
		super();
		this.login = login;
		this.password = password;
		this.name = name;
		this.surname = surname;
		this.email = email;
	}

	public Integer getRank() {
		return rank;
	}

	public void setRank(Integer rank) {
		this.rank = rank;
	}
}
